﻿using FluentValidation;
using SXICE.Core.Domains;

namespace SXICE.Service.Validators
{
    /// <summary>
    /// 医生验证器
    /// </summary>
    public class DoctorValidator : AbstractValidator<Doctor>
    {
        public DoctorValidator()
        {
            RuleFor(c => c.UserName).NotEmpty().WithMessage("用户名不能为空").Length(2, 20).WithMessage("用户名长度必须为2-20位");
            RuleFor(c => c.Password).NotEmpty().WithMessage("密码不能为空").Length(6, 20).WithMessage("密码长度必须为6-20位");
            RuleFor(c => c.RealName).NotEmpty().WithMessage("真实姓名不能为空").Length(2, 20).WithMessage("真实姓名必须为2-20位");
        }
    }
}
